
import java.util.Iterator;
public class StringQueueExample {
    // 使用迭代器删除指定字符串
    public static void removeString(Iterator<String> iterator, String target) {
        while (iterator.hasNext()) {
            String current = iterator.next();
            if (current.equals(target)) {
                iterator.remove();
            }
        }
    }
}